diff --git a/django/urls/resolvers.py b/django/urls/resolvers.py
index b021673772..57822b6f84 100644
--- a/django/urls/resolvers.py
+++ b/django/urls/resolvers.py
@@ -350,14 +350,18 @@ class LocalePrefixPattern:
 
     @property
     def language_prefix(self):
+        print("Debug: Entering language_prefix property")  # Debug print statement
         language_code = get_language() or settings.LANGUAGE_CODE
+        print(f"Debug: language_code = {language_code}, prefix_default_language = {self.prefix_default_language}")  # Debug print statement
         if language_code == settings.LANGUAGE_CODE and not self.prefix_default_language:
             return ""
         else:
             return "%s/" % language_code
 
     def match(self, path):
+        print(f"Debug: Matching path: {path}")  # Debug print statement
         language_prefix = self.language_prefix
+        print(f"Debug: Computed language_prefix: {language_prefix}")  # Debug print statement
         if path.startswith(language_prefix):
             return path.removeprefix(language_prefix), (), {}
         return None
@@ -653,11 +657,12 @@ class URLResolver:
         return name in self._callback_strs
 
     def resolve(self, path):
-        path = str(path)  # path may be a reverse_lazy object
+        print(f"Debug: Resolving path: {path}")  # Debug print statement
         tried = []
         match = self.pattern.match(path)
         if match:
-            new_path, args, kwargs = match
+            new_path, args, captured_kwargs = match
+            print(f"Debug: Match found, new_path: {new_path}, args: {args}, kwargs: {captured_kwargs}")  # Debug print statement
             for pattern in self.url_patterns:
                 try:
                     sub_match = pattern.resolve(new_path)
diff --git a/tests/i18n/sampleproject/sampleproject/settings.py b/tests/i18n/sampleproject/sampleproject/settings.py
index e69de29bb2..1d0f0bd9e4 100644
--- a/tests/i18n/sampleproject/sampleproject/settings.py
+++ b/tests/i18n/sampleproject/sampleproject/settings.py
@@ -0,0 +1,117 @@
+"""
+Django settings for sampleproject project.
+
+Generated by 'django-admin startproject' using Django 4.2.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/4.2/topics/settings/
+
+For the full list of settings and their values, see
+https://docs.djangoproject.com/en/4.2/ref/settings/
+"""
+
+from pathlib import Path
+
+# Build paths inside the project like this: BASE_DIR / 'subdir'.
+BASE_DIR = Path(__file__).resolve().parent.parent
+
+# Quick-start development settings - unsuitable for production
+# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
+
+# SECURITY WARNING: keep the secret key used in production secret!
+SECRET_KEY = 'django-insecure-...'
+
+# SECURITY WARNING: don't run with debug turned on in production!
+DEBUG = True
+
+ALLOWED_HOSTS = []
+
+# Application definition
+
+INSTALLED_APPS = [
+    'django.contrib.admin',
+    'django.contrib.auth',
+    'django.contrib.contenttypes',
+    'django.contrib.sessions',
+    'django.contrib.messages',
+    'django.contrib.staticfiles',
+]
+
+MIDDLEWARE = [
+    'django.middleware.security.SecurityMiddleware',
+    'django.contrib.sessions.middleware.SessionMiddleware',
+    'django.middleware.common.CommonMiddleware',
+    'django.middleware.csrf.CsrfViewMiddleware',
+    'django.contrib.auth.middleware.AuthenticationMiddleware',
+    'django.contrib.messages.middleware.MessageMiddleware',
+    'django.middleware.clickjacking.XFrameOptionsMiddleware',
+]
+
+ROOT_URLCONF = 'sampleproject.urls'
+
+TEMPLATES = [
+    {
+        'BACKEND': 'django.template.backends.django.DjangoTemplates',
+        'DIRS': [],
+        'APP_DIRS': True,
+        'OPTIONS': {
+            'context_processors': [
+                'django.template.context_processors.debug',
+                'django.template.context_processors.request',
+                'django.contrib.auth.context_processors.auth',
+                'django.contrib.messages.context_processors.messages',
+            ],
+        },
+    },
+]
+
+WSGI_APPLICATION = 'sampleproject.wsgi.application'
+
+# Database
+# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
+
+DATABASES = {
+    'default': {
+        'ENGINE': 'django.db.backends.sqlite3',
+        'NAME': BASE_DIR / 'db.sqlite3',
+    }
+}
+
+# Password validation
+# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
+
+AUTH_PASSWORD_VALIDATORS = [
+    {
+        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
+    },
+    {
+        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
+    },
+    {
+        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
+    },
+    {
+        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
+    },
+]
+
+# Internationalization
+# https://docs.djangoproject.com/en/4.2/topics/i18n/
+
+LANGUAGE_CODE = 'en-us'
+
+TIME_ZONE = 'UTC'
+
+USE_I18N = True
+
+USE_TZ = True
+
+# Static files (CSS, JavaScript, Images)
+# https://docs.djangoproject.com/en/4.2/howto/static-files/
+
+STATIC_URL = 'static/'
+
+# Default primary key field type
+# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
+
+DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
